import request from '@/utils/request'

//获取部门树
export function departmentTree() {
  return request({
    url: '/department/tree',
    method: 'post'
  })
}

//删除部门
export function departmentDelete(params) {
  return request({
    url: '/department/delete',
    method: 'post',
    data: params
  })
}

//保存部门
export function departmentSave(params) {
  return request({
    url: '/department/save',
    method: 'post',
    data: params
  })
}

//修改部门排序
export function departmentSort(params) {
  return request({
    url: '/department/sort',
    method: 'post',
    data: params
  })
}

//获取用户列表
export function userPage(params) {
  return request({
    url: '/user/page',
    method: 'post',
    data: params
  })
}

//获取用户详情
export function userDetail(id) {
  return request({
    url: '/user/' + id,
    method: 'post',
  })
}

//保存用户信息
export function userSave(params) {
  return request({
    url: '/user/save',
    method: 'post',
    data: params
  })
}

//删除用户信息
export function userDelete(params) {
  return request({
    url: '/user/delete',
    method: 'post',
    data: params
  })
}

//修改用户状态
export function userChangeStatus(params) {
  return request({
    url: '/user/changeStatus',
    method: 'post',
    data: params
  })
}

// 获取权限
export function getPermission() {
  return request({
    url: '/permission',
    method: 'post'
  })
}